<?php
// +----------------------------------------------------------------------
// | Description: 客户扩展设置
// +----------------------------------------------------------------------
// | Author:  Zl
// +----------------------------------------------------------------------
namespace app\crm\model;

use app\admin\model\ShopModel;
use app\admin\model\ShopRefundOrderModel;
use app\mini\model\AdminUser;
use app\shop\model\Goods;
use think\facade\Db;
use app\admin\model\Common;
use think\Request;
use think\Validate;

class CustomerPrestockExit extends Common
{
    /**
     * 为了数据库的整洁，同时又不影响Model和Controller的名称
     * 我们约定每个模块的数据表都加上相同的前缀，比如CRM模块用crm作为数据表前缀
     */
    protected $name = 'customer_prestock_exit';
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';
    protected $autoWriteTimestamp = true;


    public function shop(){
        return $this->hasOne(ShopModel::class,'shop_id','shop_id');
    }

    public function goods(){
        return $this->hasOne(Goods::class,'id','goods_id');
    }

    public function shopordergoods(){
        return $this->hasOne(ShopOrderGoods::class,'id','shop_order_goods_id');
    }
    public function shoprefundordergoods(){
        return $this->hasOne(ShopRefundOrderModel::class,'id','shop_order_goods_id');
    }

    public function customer(){
        return $this->hasOne(Customer::class,'id','customer_id');
    }

    public function operator(){
        return $this->hasOne(AdminUser::class,'id','operator_id');
    }









}

